package cn.xiaopengstack.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import cn.bugstack.middleware.db.router.annotation.DBRouterStrategy;
import cn.xiaopengstack.infrastructure.persistent.po.RaffleActivityAccountMonth;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
* @author jiangyangang
* @description 针对表【raffle_activity_account_month(抽奖活动账户表-月次数)】的数据库操作Mapper
* @createDate 2025-07-02 11:46:22
* @Entity cn.xiaopengstack.infrastructure.persistent.po.RaffleActivityAccountMonth
*/
@Mapper
@DBRouterStrategy
public interface IRaffleActivityAccountMonthDao {

    @DBRouter
    int insertSelective(RaffleActivityAccountMonth record);

    @DBRouter(key = "userId")
    RaffleActivityAccountMonth queryActivityAccountMonthByUserId(RaffleActivityAccountMonth raffleActivityAccountMonth);

    @DBRouter(key = "userId")
    int updateActivityAccountMonthSubtractionQuota(RaffleActivityAccountMonth raffleActivityAccountMonth);

    /**
     * 更新月账户额度
     * @param raffleActivityAccountMonth
     * @return
     */
    @DBRouter
    int updateAccountQuota(RaffleActivityAccountMonth raffleActivityAccountMonth);
}
